//
//  OrderDetailListView.m
//  YongChuanTradingArea
//
//  Created by 李冰 on 2017/9/21.
//  Copyright © 2017年 李冰. All rights reserved.
//

#import "OrderDetailListView.h"

@implementation OrderDetailListView

- (void)awakeFromNib {

    [super awakeFromNib];
    
}

- (void)setModel:(DecopnListModel *)model {

    _model = model;
    self.couponNumber.text = model.DecopnNumeber;
    [self.statusButton setTitle:model.DecopnState forState:UIControlStateNormal];
    if ([model.DecopnState isEqualToString:@"使用"])
    {
        self.statusButton.layer.cornerRadius = 12.5;
        self.statusButton.backgroundColor = [UIColor colorWithHex:0x13B5EA];
        [self.statusButton setTitleColor:[UIColor colorWithHex:0XFFFFFF] forState:UIControlStateNormal];
        self.statusButton.userInteractionEnabled = YES;
    }
    else
    {
        self.statusButton.layer.cornerRadius = 0.0;
        self.statusButton.backgroundColor = [UIColor colorWithHex:0xFFFFFF];
        [self.statusButton setTitleColor:[UIColor colorWithHex:0x999999] forState:UIControlStateNormal];
        self.statusButton.userInteractionEnabled = NO;
    }
}
- (IBAction)useAction:(UIButton *)sender {
    
    if (self.userBlock) self.userBlock(self.model);
}

@end
